import request from "@/utils/request";

// 广告位置分页列表
export function getPositionApi() {
  return request({
    url: "/adverts/position/list",
    method: "get",
  });
}

// 返回所有广告位置id和名字
export function getAllPositionApi() {
  return request({
    url: "/adverts/adverts/positionList",
    method: "get",
  });
}

// 新增广告位置
export function addPositionApi(data) {
  return request({
    url: "/adverts/position",
    method: "post",
    data: data,
  });
}

// 删除广告位置
export function deletePositionApi(postId) {
  return request({
    url: "/adverts/position/" + postId,
    method: "delete",
  });
}

// 根据id查询广告位置详情
export function getPositionByIdApi(postId) {
  return request({
    url: "/adverts/position/" + postId,
    method: "get",
  });
}

// 修改广告位置
export function putPositionApi(data) {
  return request({
    url: "/adverts/position",
    method: "put",
    data: data,
  });
}
